<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">
                <h:form>
                    <p:commandButton update="panel,display" icon="ui-icon-triangle-1-w" action="GradeList" title="Atras" ajax="false"/>
                    <p:commandButton update="panel,display" icon="ui-icon-home" action="MenuPrincipal" title="Menu Principal" ajax="false"/>
                </h:form>
            </ui:define>

            <ui:define name="left">

            </ui:define>

            <ui:define name="right">

            </ui:define>

            <ui:define name="content">
                <f:view>
                    <h:form>
                        <p:panel header="Curso Create/Edit" footer="Los campos con asterisco * son obligatorios." toggleable="true">
                            <h:panelGrid columns="2">

                                <p:outputLabel value="Grado:" for="grado" />
                                <p:inputMask mask="9" id="grado" value="#{gradeBean.grade.grado}" title="Grado" required="true" requiredMessage="The Grado field is required."/>

                                <p:outputLabel value="Grupo:" for="grupo" />
                                <p:inputMask mask="a" id="grupo" value="#{gradeBean.grade.grupo}" title="Grupo" required="true" requiredMessage="The Grupo field is required."/>

                                <p:outputLabel value="Materia:" for="idMateria" />
                                <p:selectOneMenu id="idMateria" value="#{gradeBean.idMateria}"  required="true" requiredMessage="The IdMateria field is required.">
                                    <!-- TODO: update below reference to list of available items-->
                                    <f:selectItems value="#{matterBean.lista}" var="item" itemLabel="#{item.nombre}" itemValue="#{item.id}"/>
                                </p:selectOneMenu>

                                <p:outputLabel value="Maestro:" for="idMaestro" />
                                <p:selectOneMenu id="idMaestro" value="#{gradeBean.idMaestro}"  required="true" requiredMessage="The IdMaestro field is required.">
                                    <!-- TODO: update below reference to list of available items-->
                                    <f:selectItems value="#{teacherBean.lista}" var="item" itemLabel="#{item.nombre} #{item.APaterno} #{item.AMaterno}" itemValue="#{item.id}"/>
                                </p:selectOneMenu>
                                <p:commandButton update="panel,display" icon="ui-icon-check" action="#{gradeBean.procesarSeleccion}" value="Aceptar" ajax="false"/>
                                <p:commandButton update="panel,display" icon="ui-icon-closethick" action="GradeList" value="Cancelar" immediate="true" ajax="false"/>
                            </h:panelGrid>
                        </p:panel>
                    </h:form>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
